package com.plant.service.impl;

import com.plant.dao.PlantMapper;
import com.plant.pojo.Plant;
import com.plant.service.PlantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("plantService")
public class PlantImplService implements PlantService {
    @Autowired
    private PlantMapper plantMapper;

    @Override
    public int addPlant(Plant plant) {

        return plantMapper.addPlant(plant);

    }

    @Override
    public List<Plant> queryAll() {
        return plantMapper.queryAll();
    }

    @Override
    public Plant queryByRn(String resourceNumber) {
        return plantMapper.queryByRn(resourceNumber);
    }

    @Override
    public List<Plant> queryBySpecies(String species) {
        return plantMapper.queryBySpecies(species);
    }

    @Override
    public void update(String resourceNumber, String name, String value) {
        plantMapper.update(resourceNumber, name, value);
    }

    @Override
    public void delete(String resourceNumber) {
        plantMapper.delete(resourceNumber);
    }
}
